package com.dev.security.manager.beans;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import com.dev.security.login.beans.LoginUser;

/**
 * 账户信息
 * @author 潜行的青衣
 * @see
 */
@Entity
@Table(name = "t_cds_account")
public class Account implements LoginUser {
	
	@Id
	@GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "id", length = 50, unique = true, nullable = false)
	private String id;
	
	@Column(name = "name", length = 50, unique = true, nullable = false)
	private String name;
	
	@Column(name = "account", length = 50)
	private String account;
	
	@Column(name = "password", length = 100)
	private String password;
	
	/**
	 * 1：生效，其他：失效
	 */
	@Column(name = "status", length = 2)
	private String status = "1";
	
	@Column(name = "createtime", length = 20)
	private String createtime;

	@Transient
	private List<String> role_ids;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getCreatetime() {
		return createtime;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	public List<String> getRole_ids() {
		return role_ids;
	}

	public void setRole_ids(List<String> role_ids) {
		this.role_ids = role_ids;
	}

	/* (non-Javadoc)
	 * @see com.dev.security.login.beans.LoginUser#getUserId()
	 */
	@Transient
	@Override
	public String getUserId() {
		return this.id;
	}

	/* (non-Javadoc)
	 * @see com.dev.security.login.beans.LoginUser#getUserAccount()
	 */
	@Transient
	@Override
	public String getUserAccount() {
		return this.account;
	}

	/* (non-Javadoc)
	 * @see com.dev.security.login.beans.LoginUser#getUserPassword()
	 */
	@Transient
	@Override
	public String getUserPassword() {
		return this.password;
	}

	/* (non-Javadoc)
	 * @see com.dev.security.login.beans.LoginUser#getUserStatus()
	 */
	@Transient
	@Override
	public String getUserStatus() {
		return this.status;
	}

	/* (non-Javadoc)
	 * @see com.dev.security.login.beans.LoginUser#getRoleIds()
	 */
	@Transient
	@Override
	public List<String> getRoleIds() {
		return this.role_ids;
	}
}
